package com.qire.manhua.dal.service;

import com.qire.antsbinder.dal.DataService;
import com.qire.antsbinder.dal.annotation.StrategyAnnotation;
import com.qire.common.constant.Url;
import com.qire.common.dal.WarehouseFactory;
import com.qire.manhua.dal.IUserDataDAL;
import com.qire.manhua.model.vo.UserDetailVO;

/** 同步用户数据 */
public class SyncUserDataService extends DataService {
    private final IUserDataDAL userDataDAL = WarehouseFactory.create(this, IUserDataDAL.class);

    /**
     * 同步刷新用户资料，更新余额
     */
    public void refreshUserDetailData() {
        // todo 可以的话，有那个这个类替换所有对于操作完后需要刷新同步用户数据的操作
        userDataDAL.refreshUserDetailData();
    }
    @StrategyAnnotation(event = Url.myIndex)
    public void requestMyIndexDataCallback(UserDetailVO dataVO, boolean isCache) {
        if(isCache || dataVO == null) return;
        dataVO.updateUserEntity();
    }
}
